package com.sping_boot3.spirng_boot3.juc.异步回调;

import java.util.concurrent.CompletableFuture;

public class 对计算结果进行处理 {
    public static void main(String[] args) {
        CompletableFuture.supplyAsync(() ->{

           return 1;
        }).thenApply( f ->{
            return f+4;
        }).whenComplete((s, throwable) -> {
            if(throwable == null){
                System.out.println(s);
            }
        });
    }
}
